﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using Srvtools;
using System.Data;


public partial class WorkTimeNN_ToneOffList : System.Web.UI.Page
{
    private Srvtools.WebDataSet WMaster;
    private string _EmployeeId;
    decimal hours = 0;

    public string EmployeeId
    {
        get
        {
            return _EmployeeId;
        }
        set
        {
            _EmployeeId = value;
        }
    }

    protected void Page_Load(object sender, EventArgs e)
    {
        MasterPage_MasterPage mpg = (MasterPage_MasterPage)this.Page.Master;
        mpg.HelpHref = "";
        mpg.PageName = "员工调休表";
        mpg.PicUrl = "";
        mpg.IntiBar();

        if (!IsPostBack)
        {

            EmployeeId = Request["Eid"].ToString();
 
            InitializeComponent();
            Master.DataSource = WMaster;
            if (_EmployeeId == null || _EmployeeId == "")
            {
                _EmployeeId = "0";
            }
            Master.SetWhere("WorkTime_OverTime2Rest.EmployeeId= " + _EmployeeId);
            wgvMaster.DataBind();

            object[] objParam = new object[1];
            objParam[0] = _EmployeeId;
            object[] myRet = CliUtils.CallMethod("SWorkTime", "GetSumDaysOfRest", objParam);
            double m = 0;
            if (myRet != null)
            {
                m = (myRet[1] != DBNull.Value && myRet[1] != null ? Convert.ToDouble(myRet[1]) : 0);
            }
            Label1.Text = "工号-" + _EmployeeId + ": 总共可用调休为" + m + "小时";
        }

    }

    private void InitializeComponent()
    {
        System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(WorkTimeNN_ToneOffList));
        this.WMaster = new Srvtools.WebDataSet();
        ((System.ComponentModel.ISupportInitialize)(this.WMaster)).BeginInit();
        // 
        // WMaster
        // 
        this.WMaster.Active = true;
        this.WMaster.AlwaysClose = false;
        this.WMaster.DeleteIncomplete = true;
        this.WMaster.Guid = null;
        this.WMaster.LastKeyValues = null;
        this.WMaster.PacketRecords = 100;
        this.WMaster.Position = -1;
        this.WMaster.RemoteName = "SWorkTime.ViewWorkTime_OverTime2Rest";
        this.WMaster.ServerModify = false;
        ((System.ComponentModel.ISupportInitialize)(this.WMaster)).EndInit();
    }

    protected void back_Click(object sender, EventArgs e)
    {
        Response.Redirect(Server.UrlDecode(Request["red"]));
    }
}
